package Day33.list集合类;

import java.util.LinkedList;

public class LinkedList实现 {
    public static void main(String[] args) {
        //创建LinkedList对象，底层创建一个空链表
        LinkedList linkedList = new LinkedList();
        linkedList.add("abc");
        linkedList.add(20);
        linkedList.add(true);
        linkedList.addFirst("hello");//首部插入
        linkedList.addLast("JavaScript");//尾部插入
        linkedList.removeFirst();//首部移除元素
        linkedList.removeLast();//尾部移除元素
        System.out.println(linkedList);
        System.out.println(linkedList.get(0));

    }
}
